<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{$current['title']}-{$Think.CONFIG.sitename}</title>
    <link href="__PUBLIC__/static/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="__PUBLIC__/static/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/static/css/animate.min.css" rel="stylesheet">
    <include file="Public/commoncss" />
</head>

<body class="gray-bg top-navigation">
<div id="wrapper">
    <div id="page-wrapper" class="gray-bg">
        <div class="row border-bottom white-bg">
            <include file="Public/header" />
        </div>
        <div class="wrapper wrapper-content">
            <div class="row">
                <div class="col-sm-12">
                    <div class="wrapper wrapper-content">
                        <div class="row animated fadeInRight">
                            <div class="col-sm-12">
                                <div class="ibox float-e-margins">
                                    <div class="ibox-title">
                                        <h5>{$current['title']}</h5>

                                        <div class="ibox-tools">
                                            <a href="javascript:;" style="color:blue;" data-toggle="modal" data-target="#modal-form">
                                                <i class="fa fa-plus"></i>添加日志
                                            </a>
                                        </div>

                                    </div>
                                    <div class="ibox-content">
                                        <notempty name="data">
                                            <div class="text-center float-e-margins p-md">
                                                <span>最近一次版本更新：</span>{$data[0]['time']|beenTime} By {$data[0]['name']};
                                            </div>
                                        </notempty>
                                        <div class="ibox-content" id="ibox-content">
                                            <div id="vertical-timeline" class="vertical-container dark-timeline center-orientation">
                                                <empty name="data">
                                                    <div class="vertical-timeline-block">
                                                        <div class="vertical-timeline-icon navy-bg">
                                                            <i class="fa fa-briefcase"></i>
                                                        </div>
                                                        <div class="vertical-timeline-content">
                                                            <h2>系统很久没更新了,已经要out了！</h2>
                                                            <p>技术在 ：568天内并没有更新过此系统!</p>
                                                            <span class="vertical-date">最后一次更新在：<br><small>{$time|date="Y年m月d日 H:i:s",###}</small></span>
                                                        </div>
                                                    </div>

                                                </empty>
                                                <notempty name="data">
                                                    <volist name="data" id="val">
                                                        <div class="vertical-timeline-block">
                                                            <div class="vertical-timeline-icon navy-bg">
                                                                <i class="fa fa-briefcase"></i>
                                                            </div>
                                                            <div class="vertical-timeline-content">
                                                                <h2>{$val.title}</h2>
                                                                <p>{$val.content}</p>
                                                                <span class="vertical-date">{$val.time|beenTime}<br><small>By:{$val.name}</small></span>
                                                            </div>
                                                        </div>
                                                    </volist>
                                                </notempty>

                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--添加窗口-->
        <div id="modal-form" class="modal fade" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-body">
                        <div class="row">
                            <form action="{:U('update')}" role="form" id="myForm">
                                <div>
                                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
                                </div>
                                <div class="col-sm-12">
                                    <h3 class="m-t-none m-b">本次程序更新</h3>
                                    <p>填写此次系统版本更新信息！</p>
                                    <div class="form-group">
                                        <label>标题：</label>
                                        <input type="text" name="title" placeholder="名称如：系统设置" class="form-control" datatype="s3-16"  nullmsg="请填写标题名称！" errormsg="标题至少3个字符！" sucmsg="标题验证通过！" autocomplete="off">
                                        <p class="Validform_checktip"></p>
                                    </div>
                                    <div class="form-group">
                                        <label>描述：</label>
                                        <textarea name="content" id="content" placeholder="页面提示" class="form-control m-b" rows="3"  style="resize: none;width:100%;"  autocomplete="off"></textarea>
                                        <input type="hidden" name="uid" value="{$user.uid}">
                                        <p class="Validform_checktip"></p>
                                    </div>
                                    <p id="dump"></p>
                                </div>
                                <div class="col-sm-12">
                                    <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>保存内容</strong></button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <include file="Public/footer" />
    </div>
</div>
<include file="Public/commonjs" />
<script src="__PUBLIC__/static/js/bootstrap.min.js?v=3.3.5"></script>
<script src="__PUBLIC__/static/js/content.min.js?v=1.0.0"></script>
<script src="__PUBLIC__/static/js/plugins/validate/Validform_v5.3.2.js"></script>
<script>
    $(document).ready(function() {
        $("#lightVersion").click(function(event) {
            event.preventDefault();
            $("#ibox-content").removeClass("ibox-content");
            $("#vertical-timeline").removeClass("dark-timeline");
            $("#vertical-timeline").addClass("light-timeline")
        });
        $("#darkVersion").click(function(event) {
            event.preventDefault();
            $("#ibox-content").addClass("ibox-content");
            $("#vertical-timeline").removeClass("light-timeline");
            $("#vertical-timeline").addClass("dark-timeline")
        });
        $("#leftVersion").click(function(event) {
            event.preventDefault();
            $("#vertical-timeline").toggleClass("center-orientation")
        })

        //提交表单
        $("#myForm").Validform({
            tiptype:function(msg,o,cssctl){
                if(!o.obj.is("form")){
                    var objtip=o.obj.siblings(".Validform_checktip");
                    cssctl(objtip,o.type);
                    objtip.text(msg);
                }else{
                    if(msg == '程序日志更新成功！'){
                        window.location.reload();
                    }else{
                        var objtip=o.obj.find("#dump");
                        cssctl(objtip,o.type);
                        objtip.text(msg);
                    }
                }
            },
            ajaxPost:true
        });
    });
</script>
</body>

</html>